package com.itheima.service.validation;

import com.itheima.anno.State;
import jakarta.validation.ConstraintValidator;
import jakarta.validation.ConstraintValidatorContext;
import jakarta.validation.Valid;
import lombok.Value;


public class StateValidation implements ConstraintValidator<State,String> {
    @Override
    public boolean isValid(String Value, ConstraintValidatorContext constraintValidatorContext) {

        if (Value == null) {
            return false;

        }
        if (Value.equals("已发布") || Value.equals("草稿")) {
            return true;
        }

        return false;
    }
}
